class Category < ActiveRecord::Base
  
  validates :name, :presence   => true
  
  belongs_to :section
  has_and_belongs_to_many :accounts  
  has_many :documents
  has_many :contents

  belongs_to :parent, class_name: "Category", foreign_key: "parent_category_id"
  has_many :subcategories, class_name: "Category", foreign_key: "parent_category_id"
  
end
